<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>任务列表效果</title>
    <link rel="stylesheet" href="./reset.css">
    <style>
        .bigbox{
            margin: 80px auto;
            width: 400px;
            border-radius: 10px;
            border: 3px solid rgb(213, 160, 61);
            background-color: rgb(244, 208, 214);
            padding: 0 2%;
        }
        .title{
            font-weight: 700;
            font-size: 18px;
            color: darkorange;
            text-align: center;
        }
        .intro{
            width: 96%;
            color: darkorange;
            text-align: center;
            border-bottom: 3px solid orange;
            font-size: 14px;
            margin: 0 auto;
        }
        .list .item{
            width: 96%;
            background-color: white; 
            display: flex;
            justify-content: space-between;
            border: 1px solid white;
            border-radius: 10px;
            align-items: center;
            margin: 10px auto;
            padding: 0 10px;
        }
        .list .item .left img{
            width: 50px;
            /* margin-left: 10px; */
            margin-top: 5px;
        }
        .list .item .middle{
            flex: 1;
        }
        .list .item .middle .name{
            font-size: 14px;
            color: rgb(107, 84, 26);
            margin-left: 5px;
        }
        .list .item .middle .desc{
            font-size: 10px;
            color: darkorange;
            margin-left: 5px;
        }
        .list .item button{
            border: none;
            width: 60px;
            height: 25px;
            background-color: darkorange;
            color: gray;
            border-radius: 20px;
            font-size: 12px;
        }
    </style>
</head>
<body>
    <!-- 由于Vue实例对象挂载到#app表示的dom节点上，所以vue实例对象身上定义的数据和方法就可以在这个dom节点内部使用（在dom节点外部不可以使用） -->
    <div id ="app">
        <div class="bigbox">
            <div class="title">任务列表</div>
            <div class="intro">每完成一个任务，即可获得10MB-1GB流量哦！</div>
            <div class="list">
                <div class="item" v-for="(item,index) in tasklist" v-bind:key="index">
                    <div class="left">
                        <img v-bind:src="item.pic" alt="">
                    </div>
                    <div class="middle">
                        <div class="name">{{ item.name }}</div>
                        <div class="desc">{{ item.desc }}</div>
                    </div>
                    <div class="right">
                        <button>{{ item.status == 1 ? '去完成':(item.status == 2 ? '领取' : '已领取') }}</button>
                    </div>
                </div>
            </div>
        </div>
       
    </div>
</body>
</html>
<script src="./vue-2.5.21.js"></script>
<script>
    var v = new Vue({
        el:'#app',
        data:{
            tasklist:[
                {id:1,pic:'../作业练习/pictures/图片1.jpeg',name:'咪咕视频送流量',desc:'来咪咕视频，每月领500MB流量奖励',status:'1'},
                {id:1,pic:'../作业练习/pictures/图片2.jpeg',name:'和彩云送福利',desc:'免费领100G空间+月月2GB',status:'2'},
                {id:1,pic:'../作业练习/pictures/图片3.jpeg',name:'最高40元太惨抵扣劵',desc:'参与抽奖，奖励10MB，经验值+10',status:'3'},
                {id:1,pic:'../作业练习/pictures/图片4.jpeg',name:'吃喝玩乐季，超级秒杀',desc:'进入隐藏二楼参与秒杀，奖励10MB，经验值+10',status:'3'}
            ]
        },
        computed: {} , //computed 定义计算属性
        watch: {} , //watch 定义数据监听
        methods: {} , //methods 定义方法(函数)
        filters: {} , //filters 定义过滤器
        directives: {} , //directives 定义自定义指令
        components: {} , //components 注册局部组件
    })
</script>